<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://unpkg.com/react@16/umd/react.development.js"></script>
    <script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
    <script src="https://unpkg.com/babel-standalone@6.26.0/babel.js"></script>
</head>

<body>
    <div id="app"></div>
    <script type="text/babel">

        class MyDom extends React.Component {
            constructor(props) {
                super(props)

                this.state = {
                    bool:true
                }
                // this.handleCLick = this.handleCLick.bind(this)
            }

            handleCLick=()=> {
                this.setState({
                    bool: !this.state.bool
                })
            }


            render() {
                return (
                    <div>
                        <button onClick={this.handleCLick}>按钮</button>
                        <p>{this.state.bool ? '张三' : '李四'}</p>
                    </div>
                )
            }

        }

        ReactDOM.render(<MyDom />, document.getElementById('app'))


    </script>
</body>

</html>